package com.cgnpc.cuddemo;

//import com.cgnpc.cud.shiro.annotation.EnableSso;
//import com.cgnpc.cud.shiro.config.EnableCudShiro;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
        import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.support.SpringBootServletInitializer;
//import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
//import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/******************************
 * 用途说明: springbootr 入口方法
 * 作者姓名: pxmwlin
 * 创建时间: 2019/6/17 11:19
 ******************************/
// 扫描指定包下面的mapper接口
// 该 @SpringBootApplication 注解等价于以默认属性使用:
//@EnableAutoConfiguration
@EnableTransactionManagement//开启事物支持
@ServletComponentScan(basePackages = "com.cgnpc.scp.filter")
@SpringBootApplication
@EnableCaching(proxyTargetClass = true) // 开启缓存功能
@ComponentScan(basePackages = {"com.cgnpc.scp","com.cgnpc.cuddemo", "cn.com.cgnpc.aep.bizcenter.appcenter.sdk","com.cgnpc.cud.core.common.util", "com.cgnpc.framework"})
//@EnableCudShiro
@MapperScan(basePackages = {"com.cgnpc.scp.**.mybatis.mapper.client"})
public class Application extends SpringBootServletInitializer {

    /***********************************
    * 用途说明: 入口方法
    * 参数说明 args
    * 返回值说明:
    ***********************************/
    public static void main(String[] args) throws Exception {
        SpringApplication.run(Application.class, args);
    }

    /**********************************
    * 用途说明: 程序打war包需要的
    * 参数说明 application
    * 返回值说明:
    ***********************************/
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }
}
